package lesson18_IO;

import java.io.File;
import java.util.Arrays;

public class DirList {
	public static void main(String[] args) {
		File path = new File(".");
		String[] list;
		if (args.length == 0) {
			list = path.list();
		} else {
			list = path.list(new DirFilter(args[0]));
			Arrays.sort(list, String.CASE_INSENSITIVE_ORDER);
			for (String s : list) {
				System.out.println(s);
			}
		}
	}
}